<template>
	<div>
		<!-- 定尺管理 -->
		<pol-title title="定尺管理">
			<template #right>
				<div class="padding-right">
					<el-button icon="Plus" type="primary" class="btn-bg-blue btn-box padding-lr" style="height: 26px; line-height: 26px;" @click="dialogHeatScheduleEdit = true">新增</el-button>
				</div>
			</template>
		</pol-title>

		<div class="padding-lr border-solid bg-tm radius-sm main-box-height padding-top">
			<!-- 表格 -->
			<pol-table ref="polTableRef" v-bind="tableOpt" height="100%">
				<template #P_IsReadOnly="{row}">
					<div class="flex align-center justify-center">
						<span class="text-green2 cursor margin-left-lg">编辑</span>
						<span class="text-green2 cursor margin-left-lg">删除</span>
					</div>
				</template>
			</pol-table>
		</div>

		<!-- 弹窗 -->
		<el-dialog v-model="dialogHeatScheduleEdit" title="新增定尺" width="1100" center align-center>
			<div class="padding search-light">
				<lay-json-schema-form :model="formData" :schema="schema2"></lay-json-schema-form>
				<div class="margin-top-xl flex justify-center align-center">
					<el-button class="padding-lr-xl text-blue3 solid-blue" size="large" @click="dialogHeatScheduleEdit = false">返回</el-button>
					<div class="margin-left-xxl">
						<el-button type="primary" class="btn-bg-blue btn-box padding-lr-xl" size="large">保存</el-button>
					</div>
				</div>
			</div>
		</el-dialog>
	</div>
</template>

<script setup>
	import { ref } from 'vue';

	const dialogHeatScheduleEdit = ref(false)

	//表单数据
	const formData = ref({
		CardTypeCode: '', //
		CardTypeName: '', //
	});

	//表单配置
	const schema2 = ref({
		CardTypeCode: {
			label: '启用状态：',
			type: 'input',
			props: {
				type: 'text',
				placeholder: '请输入启用状态',
			},
			colProps: {
				md: 24,
			},
		},
		CardTypeName: {
			label: '冷坯长度：',
			type: 'input',
			props: {
				type: 'text',
				placeholder: '请输入冷坯长度',
			},
			colProps: {
				md: 24,
			},
		},
		CardTypeName3: {
			label: '热坯长度：',
			type: 'input',
			props: {
				type: 'text',
				placeholder: '请输入热坯长度',
			},
			colProps: {
				md: 24,
			},
		},
		CardTypeName4: {
			label: '描述：',
			type: 'textarea',
			props: {
				type: 'textarea',
				placeholder: '请输入描述',
			},
			colProps: {
				md: 24,
			},
		},
	});

	const polTableRef = ref(null); //表格ref
	//表格配置
	const columns = ref([
		{ label: '启用状态', key: 'ItemCode', align: 'center' },
		{ label: '冷坯长度', key: 'ItemName', align: 'center' },
		{ label: '热坯长度', key: 'ItemValue', align: 'center' },
		{ label: '断面参数2', key: 'IsDefault', align: 'center' },
		{ label: '描述', key: 'P_IsSys', align: 'center' },
		{ label: '操作', key: 'P_IsReadOnly', align: 'center', width: '180', slot: true },
	]);

	//表格配置
	const tableOpt = ref({
		columns: columns.value,
		localData: [{
				ItemCode: '启用',
				ItemName: '7',
				ItemValue: '7.008',
				IsDefault: '0.5',
				P_IsSys: '0.18',
			},
			{
				ItemCode: '启用',
				ItemName: '7',
				ItemValue: '7.008',
				IsDefault: '0.5',
				P_IsSys: '0.18',
			}, {
				ItemCode: '启用',
				ItemName: '7',
				ItemValue: '7.008',
				IsDefault: '0.5',
				P_IsSys: '0.18',
			}, {
				ItemCode: '启用',
				ItemName: '7',
				ItemValue: '7.008',
				IsDefault: '0.5',
				P_IsSys: '0.18',
			}, {
				ItemCode: '启用',
				ItemName: '7',
				ItemValue: '7.008',
				IsDefault: '0.5',
				P_IsSys: '0.18',
			}, {
				ItemCode: '启用',
				ItemName: '7',
				ItemValue: '7.008',
				IsDefault: '0.5',
				P_IsSys: '0.18',
			}, {
				ItemCode: '启用',
				ItemName: '7',
				ItemValue: '7.008',
				IsDefault: '0.5',
				P_IsSys: '0.18',
			}, {
				ItemCode: '启用',
				ItemName: '7',
				ItemValue: '7.008',
				IsDefault: '0.5',
				P_IsSys: '0.18',
			}, {
				ItemCode: '启用',
				ItemName: '7',
				ItemValue: '7.008',
				IsDefault: '0.5',
				P_IsSys: '0.18',
			}, {
				ItemCode: '启用',
				ItemName: '7',
				ItemValue: '7.008',
				IsDefault: '0.5',
				P_IsSys: '0.18',
			}, {
				ItemCode: '启用',
				ItemName: '7',
				ItemValue: '7.008',
				IsDefault: '0.5',
				P_IsSys: '0.18',
			},
		]
	});
</script>

<style lang="scss" scoped>

</style>